Update samples/webserver/ringlibsdl/webserver.ring - use C_BUFFERSIZE constant.
@@ -9,7 +9,7 @@ cContent = "<html><head><title>Goodbye, world!</title></head>" +
"<body>Welcome to Network Programming!!</body></html>"
cResponse += cContent
-nCount = 0
+C_BUFFERSIZE = 400
func main
? "Web Server - Port " + C_PORT
@@ -17,7 +17,7 @@ func main
oAddress = sdl_new_ipaddress()
SDLNet_ResolveHost(oAddress,"0.0.0.0",C_PORT)
oServer = SDLNet_Tcp_Open(oAddress)
- mydata = space(400)
+ mydata = space(C_BUFFERSIZE)
pData = varptr(:mydata,"void")
pResponse = varptr(:cResponse,"void")
nSize = len(cResponse)
@@ -29,7 +29,7 @@ func main
func NewClient oServer,mydata,pData,pResponse,nSize
oSocket = SDLNet_Tcp_Accept(oServer)
if ptrcmp(oSocket,NULL) = False
- sdlnet_tcp_recv(oSocket,pData,400)
+ sdlnet_tcp_recv(oSocket,pData,C_BUFFERSIZE)
sdlnet_tcp_send(oSocket,pResponse,nSize)
SDLNet_tcp_close(oSocket)
ok
