Permalink
Browse files

move pv init to dcopv.bdy, rseq for last send seq

  • Loading branch information...
1 parent 50455ad commit 70a6b5776916527f27b130c75ca12767eac22278 @kaven276 committed Oct 10, 2012
Showing with 20 additions and 17 deletions.
  1. +1 −0 lib/ext_hub.js
  2. +17 −0 oracle/psp/dcopv.bdy
  3. +2 −17 oracle/psp/k_ext_call.bdy
View
1 lib/ext_hub.js
@@ -91,6 +91,7 @@ var server = net.createServer(function(oraSock){
}
function onOracleRequest(oraReq){
+ rec.oraSeq++;
var proxyID = oraReq.readInt32BE(4)
, wpw = wpSocks[proxyID]
;
View
17 oracle/psp/dcopv.bdy
@@ -0,0 +1,17 @@
+create or replace package body dcopv is
+begin
+ dbms_lob.createtemporary(msg, cache => true, dur => dbms_lob.session);
+ chksz := dbms_lob.getchunksize(msg);
+ pos_head := 0;
+ pos_tail := 12;
+ rseq := 0;
+ rseq2 := 0;
+ onway := 0;
+ onbuf := 0;
+ dbms_alert.register('Noradle-DCO-EXTHUB-QUIT');
+ if host is not null and port is not null then
+ dbms_alert.signal('Noradle-DCO-EXTHUB-QUIT', host || ':' || port);
+ end if;
+ commit;
+end dcopv;
+/
View
19 oracle/psp/k_ext_call.bdy
@@ -6,19 +6,6 @@ create or replace package body k_ext_call is
return utl_raw.cast_from_binary_integer(i);
end;
- procedure init is
- begin
- dbms_lob.createtemporary(dcopv.msg, cache => true, dur => dbms_lob.session);
- dcopv.chksz := dbms_lob.getchunksize(dcopv.msg);
- dcopv.pos_head := 0;
- dcopv.pos_tail := 12;
- dcopv.rseq := 1;
- dcopv.rseq2 := 1;
- dcopv.onway := 0;
- dcopv.onbuf := 0;
- dbms_alert.register('Noradle-DCO-EXTHUB-QUIT');
- end;
-
procedure write(content in out nocopy raw) is
v_len pls_integer := utl_raw.length(content);
begin
@@ -184,9 +171,9 @@ create or replace package body k_ext_call is
if not buffered then
flush;
end if;
- dcopv.rsps(dcopv.rseq) := null;
dcopv.rseq := dcopv.rseq + 1;
- return dcopv.rseq - 1;
+ dcopv.rsps(dcopv.rseq) := null;
+ return dcopv.rseq;
end;
function send_request
@@ -279,7 +266,5 @@ create or replace package body k_ext_call is
return read_response(send_request(proxy_id, false), req_blb, timeout);
end;
-begin
- init;
end k_ext_call;
/

0 comments on commit 70a6b57

Please sign in to comment.