Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0e4d43f

Browse files
committed
The attached patch removes some old and dead code (and some related
misleading comments) from the PG_Stream class. Anders Bengtsson
1 parent 5f5f8b9 commit 0e4d43f

File tree

2 files changed

+1
-57
lines changed

2 files changed

+1
-57
lines changed

src/interfaces/jdbc/org/postgresql/PG_Stream.java

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ public PG_Stream(String host, int port) throws IOException
5656
*/
5757
public void SendChar(int val) throws IOException
5858
{
59-
// Original code
60-
//byte b[] = new byte[1];
61-
//b[0] = (byte)val;
62-
//pg_output.write(b);
63-
64-
// Optimised version by Sverre H. Huseby Aug 22 1999 Applied Sep 13 1999
6559
pg_output.write((byte)val);
6660
}
6761

@@ -84,30 +78,6 @@ public void SendInteger(int val, int siz) throws IOException
8478
Send(buf);
8579
}
8680

87-
/**
88-
* Sends an integer to the back end in reverse order.
89-
*
90-
* This is required when the backend uses the routines in the
91-
* src/backend/libpq/pqcomprim.c module.
92-
*
93-
* As time goes by, this should become obsolete.
94-
*
95-
* @param val the integer to be sent
96-
* @param siz the length of the integer in bytes (size of structure)
97-
* @exception IOException if an I/O error occurs
98-
*/
99-
public void SendIntegerReverse(int val, int siz) throws IOException
100-
{
101-
byte[] buf = bytePoolDim1.allocByte(siz);
102-
int p=0;
103-
while (siz-- > 0)
104-
{
105-
buf[p++] = (byte)(val & 0xff);
106-
val >>= 8;
107-
}
108-
Send(buf);
109-
}
110-
11181
/**
11282
* Send an array of bytes to the backend
11383
*
@@ -155,17 +125,6 @@ public void Send(byte buf[], int off, int siz) throws IOException
155125
}
156126
}
157127

158-
/**
159-
* Sends a packet, prefixed with the packet's length
160-
* @param buf buffer to send
161-
* @exception SQLException if an I/O Error returns
162-
*/
163-
public void SendPacket(byte[] buf) throws IOException
164-
{
165-
SendInteger(buf.length+4,4);
166-
Send(buf);
167-
}
168-
169128
/**
170129
* Receives a single character from the backend
171130
*

src/interfaces/jdbc/org/postgresql/fastpath/Fastpath.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,6 @@
1818
*
1919
* <p>It is based around the file src/interfaces/libpq/fe-exec.c
2020
*
21-
*
22-
* <p><b>Implementation notes:</b>
23-
*
24-
* <p><b><em>Network protocol:</em></b>
25-
*
26-
* <p>The code within the backend reads integers in reverse.
27-
*
28-
* <p>There is work in progress to convert all of the protocol to
29-
* network order but it may not be there for v6.3
30-
*
31-
* <p>When fastpath switches, simply replace SendIntegerReverse() with
32-
* SendInteger()
33-
*
3421
* @see org.postgresql.FastpathFastpathArg
3522
* @see org.postgresql.LargeObject
3623
*/
@@ -80,9 +67,7 @@ public Object fastpath(int fnid,boolean resulttype,FastpathArg[] args) throws SQ
8067
// that confuses the backend. The 0 terminates the command line.
8168
stream.SendInteger(70,1);
8269
stream.SendInteger(0,1);
83-
84-
//stream.SendIntegerReverse(fnid,4);
85-
//stream.SendIntegerReverse(args.length,4);
70+
8671
stream.SendInteger(fnid,4);
8772
stream.SendInteger(args.length,4);
8873

0 commit comments

Comments
 (0)