-CC=gcc\r
+CC=clang++\r
\r
C_OPTS=-Wall -Wextra -pedantic\r
C_OPTS+=src/matrix.c\r
C_OPTS+=-I ext/olm/include/\r
C_OPTS+=-I ext/mjson/src/\r
C_OPTS+=-I ext/mongoose/\r
-C_OPTS+=-L out/olm/\r
C_OPTS+=-l ws2_32\r
C_OPTS+=-l ssl\r
C_OPTS+=-l crypto\r
-C_OPTS+=-l olm\r
+C_OPTS+=out/olm/libolm.a\r
C_OPTS+=-D MG_ENABLE_OPENSSL=1\r
+C_OPTS+=-fuse-ld=lld.exe -g -gcodeview -Wl,/debug,/pdb:test.pdb\r
# C_OPTS+=-I ext/curl/include/\r
# C_OPTS+=-L ext/curl/build/lib/\r
# C_OPTS+=-l curl\r
"\"algorithm\":\"m.megolm.v1.aes-sha2\","\r
"\"sender_key\":\"%s\","\r
"\"ciphertext\":\"%s\","\r
- "\"session_id\":%s,"\r
+ "\"session_id\":\"%s\","\r
"\"device_id\":\"%s\""\r
"}",\r
senderKey,\r
// If s_url is https://, tell client connection to use TLS\r
if (mg_url_is_ssl(client->server))\r
{\r
- struct mg_tls_opts opts;\r
+ static struct mg_tls_opts opts;\r
opts.srvname = host;\r
mg_tls_init(c, &opts);\r
}\r
\r
mg_mgr_init(&conn->mgr);\r
\r
- mg_http_connect(&conn->mgr, client->server, MatrixHttpCallback, client);\r
+ struct mg_connection * c =\r
+ mg_http_connect(&conn->mgr, client->server, MatrixHttpCallback, client);\r
\r
while (! conn->connected)\r
mg_mgr_poll(&conn->mgr, 1000);\r
else\r
authorizationHeader[0] = '\0';\r
\r
+ printf("PUT %s HTTP/1.0\r\n"\r
+ "Host: %.*s\r\n"\r
+ "%s"\r
+ "Content-Type: application/json\r\n"\r
+ "Content-Length: %d\r\n"\r
+ "\r\n"\r
+ "%s"\r
+ "\r\n",\r
+ url,\r
+ host.len, host.ptr,\r
+ authorizationHeader,\r
+ strlen(requestBuffer),\r
+ requestBuffer);\r
+\r
mg_printf(conn->connection,\r
"PUT %s HTTP/1.0\r\n"\r
"Host: %.*s\r\n"\r