-/*
- dispatch any incoming meta requests
-*/
-int handle_incoming_meta_data(conn_list_t *cl)
-{
- int x, l = sizeof(x), lenin;
- unsigned char tmp[1600];
- int request;
-cp
- if(getsockopt(cl->meta_socket, SOL_SOCKET, SO_ERROR, &x, &l) < 0)
- {
- syslog(LOG_ERR, "This is a bug: %s:%d: %d:%m", __FILE__, __LINE__, cl->meta_socket);
- return -1;
- }
- if(x)
- {
- syslog(LOG_ERR, "Metadata socket error: %s", sys_errlist[x]);
- return -1;
- }
-
- if((lenin = recv(cl->meta_socket, &tmp, sizeof(tmp), 0)) <= 0)
- {
- syslog(LOG_ERR, "Receive failed: %m");
- return -1;
- }
-
- request = (int)(tmp[0]);
-
- if(debug_lvl > 3)
- syslog(LOG_DEBUG, "got request %d", request);
-
- if(request_handlers[request] == NULL)
- syslog(LOG_ERR, "Unknown request %d.", request);
- else
- if(request_handlers[request](cl, tmp, lenin) < 0)
- return -1;
-cp
- return 0;
-}
-