diff options
author | lpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-05 19:05:47 +0000 |
---|---|---|
committer | lpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-05 19:05:47 +0000 |
commit | fcb6f89d0176c3fa28a20cf3d958ee91f9c18799 (patch) | |
tree | 18848335adaab956ed8230057abb28802084639f /StdLib/EfiSocketLib | |
parent | 50b43b1506f927f94f7e655e6f2c2a27413f8914 (diff) | |
download | edk2-fcb6f89d0176c3fa28a20cf3d958ee91f9c18799.zip edk2-fcb6f89d0176c3fa28a20cf3d958ee91f9c18799.tar.gz edk2-fcb6f89d0176c3fa28a20cf3d958ee91f9c18799.tar.bz2 |
Fix read issue detected by the following Python program. The issue was that the caller's buffer pointer was not being advanced between segments of the read data.
Signed-off-by: lpleahy
----- UnbufferedRead.py -----
import httplib
conn = httplib.HTTPConnection("10.241.97.30")
conn.request('GET', '/')
resp = conn.getresponse(buffering=True)
if resp.status != 200:
print "status:", resp.status
print "aborting"
sys.exit(1)
while True:
chunk = resp.read()
if not chunk:
break
print chunk
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13077 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/EfiSocketLib')
-rw-r--r-- | StdLib/EfiSocketLib/Tcp4.c | 5 | ||||
-rw-r--r-- | StdLib/EfiSocketLib/Tcp6.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/StdLib/EfiSocketLib/Tcp4.c b/StdLib/EfiSocketLib/Tcp4.c index 32c7a39..8044d80 100644 --- a/StdLib/EfiSocketLib/Tcp4.c +++ b/StdLib/EfiSocketLib/Tcp4.c @@ -1572,6 +1572,11 @@ EslTcp4Receive ( CopyMem ( pBuffer, pPacket->pBuffer, DataLength );
//
+ // Set the next buffer address
+ //
+ pBuffer += DataLength;
+
+ //
// Determine if the data is being read
//
if ( *pbConsumePacket ) {
diff --git a/StdLib/EfiSocketLib/Tcp6.c b/StdLib/EfiSocketLib/Tcp6.c index 6f2cf75..b070aaa 100644 --- a/StdLib/EfiSocketLib/Tcp6.c +++ b/StdLib/EfiSocketLib/Tcp6.c @@ -1636,6 +1636,11 @@ EslTcp6Receive ( CopyMem ( pBuffer, pPacket->pBuffer, DataLength );
//
+ // Set the next buffer address
+ //
+ pBuffer += DataLength;
+
+ //
// Determine if the data is being read
//
if ( *pbConsumePacket ) {
|