View Issue Details

IDProjectCategoryView StatusLast Update
0000442LDMud 3.3Networkingpublic2018-01-29 22:57
Reporterfippo Assigned Tolars 
Status resolvedResolutionfixed 
Product Version3.3.712 
Fixed in Version3.3.716 
Summary0000442: socket closes after reading MAX_TEXT bytes
DescriptionWhen reading large chunks of data from a socket, the driver prematurely closes the socket.

ip->text_end remains at MAX_TEXT, which triggers a zero-byte read in the next cycle, closing the socket.

In the attached example 'reader.c', feed is called first with a newline \n only (most likely the result of a 'faking NL' ~ line 3230 of comm.c), then with the data, finally with an empty string. After that, the driver tries to read zero bytes, which closes the socket.

Workaround: increase MAX_TEXT

(hint: decrease MAX_TEXT for debugging :-)
TagsNo tags attached.


2006-01-09 13:12


reader.c (273 bytes)

2006-01-09 13:26 (544 bytes)


2006-01-09 13:27

reporter   ~0000473 reproduces the bug (with MAX_TEXT set to 128).
Only the string of ones is received on LPC level


2007-10-07 18:42

reporter   ~0000561

While the problem is indeed caused with the faking of a NL when reading a full buffers worth of data
in charmode with combine-charset(!), I couldn't quite determine what exactly is going wrong.

The cheap solution is simply to not read MAX_TEXT worth of data in charmode, avoiding the situation

Issue History

Date Modified Username Field Change
2006-01-09 13:12 fippo New Issue
2006-01-09 13:12 fippo File Added: reader.c
2006-01-09 13:26 fippo File Added:
2006-01-09 13:27 fippo Note Added: 0000473
2007-10-07 18:42 lars Status new => resolved
2007-10-07 18:42 lars Fixed in Version => 3.3.716
2007-10-07 18:42 lars Resolution open => fixed
2007-10-07 18:42 lars Assigned To => lars
2007-10-07 18:42 lars Note Added: 0000561
2010-11-16 10:42 lars Source_changeset_attached => ldmud.git master 3ba704b3
2018-01-29 19:59 lars Source_changeset_attached => ldmud.git master 3ba704b3
2018-01-29 22:57 lars Source_changeset_attached => ldmud.git master 3ba704b3