Skip to content

Commit

Permalink
suppress syslog regarding unexpectedly closed socket connection
Browse files Browse the repository at this point in the history
also add mostly-static build command to build.sh
  • Loading branch information
HunterZ committed Sep 6, 2014
1 parent 0ee0658 commit 770fa3f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ pixelserv

Tiny webserver that responds to all requests with "nothing". Particularly useful for network connections with high latency and metered bandwidth.

This fork merges the mstombs and h0tw1r3 forks back together, and adds some additional cleanups and enhancements (most notably a stats reporting URL and finer-grained stats collection, as well as command-line configurable timeouts).

Sources
-------

* https://github.com/flexiondotorg/nullserv
* https://github.com/flexiondotorg/nullserv (defunct)
* http://www.linksysinfo.org/index.php?threads/pixelserv-compiled-to-run-on-router-wrt54g.30509/page-3#post-229342
* http://www.dd-wrt.com/phpBB2/viewtopic.php?p=685201
15 changes: 7 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ ls -laF $BIN

# use Linksys Tomato toolchain (or teddy_bear tomatousb K26, Tornado dd-wrt)
#export PATH=/opt/brcm/hndtools-mipsel-uclibc/bin:/opt/brcm/hndtools-mipsel-linux/bin:$PATH
#tomato standard
CC="mipsel-uclibc-gcc -mips32"
CFLAGS="-Os -s -Wall -ffunction-sections -fdata-sections"
LDFLAGS="-Wl,--gc-sections"
STRIP="mipsel-uclibc-strip -s -R .note -R .comment -R .gnu.version -R .gnu.version_r"

#tomato
OPTS="-DTEXT_REPLY -DDROP_ROOT -DNULLSERV_REPLIES -DSSL_RESP -DMULTIPORT -DIF_MODE -DSTATS_REPLY -DREDIRECT"
# -DIF_MODE "-i br0" responsible for failures when gui changes made
# -DREAD_FILE -DREAD_GIF over-ridden by -DNULLSERV_REPLIES
Expand All @@ -32,12 +31,12 @@ $CC $CFLAGS $LDFLAGS $OPTS $SRC -o $BIN
$STRIP $BIN
ls -laF $BIN

#tomato static (leandroong) - doesn't build for me due to missing libgcc_s.so
#LDFLAGS="-Wl,--gc-sections,-static"
#BIN=$OUT.static
#$CC $CFLAGS $LDFLAGS $OPTS $SRC -o $BIN
#$STRIP $BIN
#ls -laF $BIN
#tomato static - excludes libgcc_s.so because my toolchain doesn't have it
LDFLAGS="-static -Wl,--gc-sections,-Bdynamic,-lgcc_s,-Bstatic"
BIN=$OUT.static
$CC $CFLAGS $LDFLAGS $OPTS $SRC -o $BIN
$STRIP $BIN
ls -laF $BIN

#tomato tiny
LDFLAGS="-Wl,--gc-sections"
Expand Down
5 changes: 3 additions & 2 deletions pixelserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* single pixel http string from http://proxytunnel.sourceforge.net/pixelserv.php
*/

#define VERSION "V35.HZ7"
#define VERSION "V35.HZ8"

#define BACKLOG 30 // how many pending connections queue will hold
#define CHAR_BUF_SIZE 2048 // surprising how big requests can be with cookies and lengthy yahoo url!
Expand Down Expand Up @@ -1045,7 +1045,7 @@ static unsigned char SSL_no[] =
syslog(LOG_ERR, "recv() returned error: %m");
} else if (rv == 0) {
status = FAIL_CLOSED;
syslog(LOG_ERR, "client closed connection without sending any data");
MYLOG(LOG_ERR, "client closed connection without sending any data");
} else {
buf[rv] = '\0';
TESTPRINT("\nreceived %d bytes\n'%s'\n", rv, buf);
Expand Down Expand Up @@ -1346,4 +1346,5 @@ V35.HZ7 add plaintext stats response
add configurable timeout(s)
increase default timeout(s) per mstombs suggestion
integrate transparent+caching .ico response from M0g13r/mstombs
V35.HZ8 suppress syslog regarding unexpectedly closed socket connection
*/

0 comments on commit 770fa3f

Please sign in to comment.