Update functions

This commit is contained in:
Arron Vinyard
2020-04-23 23:24:00 -04:00
committed by GitHub
parent c0ca4b2a2f
commit d1f0703d78
+8 -2
View File
@@ -29,7 +29,13 @@ public void OnSocketConnected(Socket socket, any arg) {
// socket is connected, send the http request // socket is connected, send the http request
char requestStr[100]; char requestStr[100];
Format(requestStr, sizeof(requestStr), "GET /%s HTTP/1.0\r\nHost: %s\r\nConnection: close\r\n\r\n", "index.php", "www.sourcemod.net"); FormatEx(
requestStr,
sizeof(requestStr),
"GET /%s HTTP/1.0\r\nHost: %s\r\nConnection: close\r\n\r\n",
"index.php",
"www.sourcemod.net"
);
socket.Send(requestStr); socket.Send(requestStr);
} }
@@ -37,7 +43,7 @@ public void OnSocketReceive(Socket socket, char[] receiveData, const int dataSiz
// receive another chunk and write it to <modfolder>/dl.htm // receive another chunk and write it to <modfolder>/dl.htm
// we could strip the http response header here, but for example's sake we'll leave it in // we could strip the http response header here, but for example's sake we'll leave it in
WriteFileString(hFile, receiveData, false); hFile.WriteString(receiveData, false);
} }
public void OnSocketDisconnected(Socket socket, any hFile) { public void OnSocketDisconnected(Socket socket, any hFile) {