Skip to content
Snippets Groups Projects
Commit 86281a6b authored by dg's avatar dg
Browse files

test

git-svn-id: http://svn.net-core.org/repos/t-engine4@2748 51575b47-30f0-44d4-a5cc-537603b46e54
parent 19c3a5ac
No related branches found
No related tags found
No related merge requests found
......@@ -537,7 +537,7 @@ static const char *getF (lua_State *L, void *ud, size_t *size) {
return "\n";
}
if (PHYSFS_eof(lf->f)) return NULL;
*size = (size_t)PHYSFS_read(lf->f, lf->buff, 1, 1);
*size = (size_t)PHYSFS_read(lf->f, lf->buff, 1, sizeof(lf->buff));
return (*size > 0) ? lf->buff : NULL;
}
......
......@@ -537,7 +537,7 @@ static const char *getF (lua_State *L, void *ud, size_t *size) {
return "\n";
}
if (PHYSFS_eof(lf->f)) return NULL;
*size = (size_t)PHYSFS_read(lf->f, lf->buff, 1, 1);
*size = (size_t)PHYSFS_read(lf->f, lf->buff, 1, sizeof(lf->buff));
return (*size > 0) ? lf->buff : NULL;
}
......
......@@ -28,6 +28,7 @@
#include "main.h"
#include "profile.h"
#include "lua_externs.h"
#include "zhelpers.h"
static profile_type *main_profile;
......@@ -41,7 +42,7 @@ int thread_profile(void *data)
luaopen_mime_core(L);
profile->L = L;
profile->s_req = zmq_socket(Z, ZMQ_SUB);
profile->s_req = zmq_socket(Z, ZMQ_REQ);
zmq_connect(profile->s_req, "tcp://te4.org:2257");
// And run the lua engine pre init scripts
......@@ -56,13 +57,12 @@ int thread_profile(void *data)
while (profile->running)
{
if (!profile->running) break;
printf("=== running\n");
zmq_msg_t reply;
zmq_msg_init(&reply);
zmq_recv(profile->s_req, &reply, 0);
printf("Received reply %d: [%s]\n", request_nbr,
(char *) zmq_msg_data (&reply));
zmq_msg_close(&reply);
s_send (profile->s_req, "We don't want to see this");
char *toto = s_recv (profile->s_req);
printf("=== rep %s\n", toto);
free(toto);
request_nbr++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment