Exemplo n.º 1
0
Boolean service_recvStatus(const int a_socket)
{
	Message msg;
	
	// init vars
		Message_clear(&msg);
	
	return (siftp_recv(a_socket, &msg) &&  Message_hasType(&msg, SIFTP_VERBS_COMMAND_STATUS) && Message_hasValue(&msg, "true"));
}
Exemplo n.º 2
0
Boolean service_sendStatus(const int a_socket, const Boolean a_wasSuccess)
{
	Message msg;
	
	// init variables
		Message_clear(&msg);
		Message_setType(&msg, SIFTP_VERBS_COMMAND_STATUS);
		Message_setValue(&msg, a_wasSuccess ? "true" : "false");
		
	return siftp_send(a_socket, &msg);
}
Exemplo n.º 3
0
Boolean session_destroy(const int a_socket)
{
	#ifndef NODEBUG
		printf("session_destroy(): closing session.");
	#endif
	
	// variables
		Message msgOut;
		
	// init vars
		Message_clear(&msgOut);
		
	// send notice
		Message_setType(&msgOut, SIFTP_VERBS_SESSION_END);
		return siftp_send(a_socket, &msgOut);
}
static void
Message_dealloc(Message *self)
{
  Message_clear(self);
  PyUnicode_Type.tp_dealloc((PyObject*)self);
}