Ejemplo n.º 1
0
Archivo: lmtp.c Proyecto: jinwon/dbmail
static void lmtp_handle_input(void *arg)
{
	int l;
	char buffer[MAX_LINESIZE];	/* connection buffer */
	ClientSession_T *session = (ClientSession_T *)arg;
	while (TRUE) {
		memset(buffer, 0, sizeof(buffer));

		l = ci_readln(session->ci, buffer);

		if (l==0) break;

		if ((l = lmtp_tokenizer(session, buffer))) {
			if (l == -3) {
				client_session_bailout(&session);
				return;
			}

			if (l > 0) {
				if (lmtp(session) == -3) {
					client_session_bailout(&session);
					return;
				}
				client_session_reset_parser(session);
			}

			if (l < 0) {
				client_session_reset_parser(session);
			}
		}
	}

	TRACE(TRACE_DEBUG,"[%p] done", session);
}
Ejemplo n.º 2
0
static void tims_handle_input(void *arg)
{
	int l = 0;
	char buffer[MAX_LINESIZE];	/* connection buffer */
	ClientSession_t *session = (ClientSession_t *)arg;

	ci_cork(session->ci);

	while (TRUE) {
		memset(buffer, 0, sizeof(buffer));
		l = ci_readln(session->ci, buffer);

		if (l == 0) break;

		if ((l = tims_tokenizer(session, buffer))) {
			if (l == -3) {
				client_session_bailout(&session);
				return;
			}
			if (tims(session) == -3) {
				client_session_bailout(&session);
				return;
			}
			client_session_reset_parser(session);
		}
	}

	if (session->state < QUIT)
		ci_uncork(session->ci);
}
Ejemplo n.º 3
0
void client_session_reset(ClientSession_t * session)
{
	dsnuser_free_list(session->rcpt);
	session->rcpt = NULL;

	g_list_destroy(session->from);
	session->from = NULL;

	if (session->apop_stamp) {
		g_free(session->apop_stamp);
		session->apop_stamp = NULL;
	}

	if (session->username) {
		g_free(session->username);
		session->username = NULL;
	}

	if (session->password) {
		g_free(session->password);
		session->password = NULL;
	}

	session->state = CLIENTSTATE_INITIAL_CONNECT;

	client_session_reset_parser(session);
}