Lines Matching refs:smbc
380 struct smb_conn *smbc = &data->conn->proto.smbc; in conn_state() local
392 if(smbc->state != newstate) in conn_state()
394 (void *)smbc, names[smbc->state], names[newstate]); in conn_state()
397 smbc->state = newstate; in conn_state()
445 struct smb_conn *smbc = &conn->proto.smbc; in smb_connect() local
455 smbc->state = SMB_CONNECTING; in smb_connect()
456 smbc->recv_buf = malloc(MAX_MESSAGE_SIZE); in smb_connect()
457 if(!smbc->recv_buf) in smb_connect()
469 smbc->user = slash + 1; in smb_connect()
470 smbc->domain = strdup(conn->user); in smb_connect()
471 if(!smbc->domain) in smb_connect()
473 smbc->domain[slash - conn->user] = 0; in smb_connect()
476 smbc->user = conn->user; in smb_connect()
477 smbc->domain = strdup(conn->host.name); in smb_connect()
478 if(!smbc->domain) in smb_connect()
489 struct smb_conn *smbc = &conn->proto.smbc; in smb_recv_message() local
490 char *buf = smbc->recv_buf; in smb_recv_message()
494 size_t len = MAX_MESSAGE_SIZE - smbc->got; in smb_recv_message()
497 result = Curl_read(data, sockfd, buf + smbc->got, len, &bytes_read); in smb_recv_message()
504 smbc->got += bytes_read; in smb_recv_message()
507 if(smbc->got < sizeof(unsigned int)) in smb_recv_message()
513 if(smbc->got < nbt_size) in smb_recv_message()
536 struct smb_conn *smbc = &conn->proto.smbc; in smb_pop_message() local
538 smbc->got = 0; in smb_pop_message()
545 struct smb_conn *smbc = &conn->proto.smbc; in smb_format_message() local
556 h->uid = smb_swap16(smbc->uid); in smb_format_message()
567 struct smb_conn *smbc = &conn->proto.smbc; in smb_send() local
577 smbc->send_size = len; in smb_send()
578 smbc->sent = bytes_written; in smb_send()
581 smbc->upload_size = upload_size; in smb_send()
589 struct smb_conn *smbc = &conn->proto.smbc; in smb_flush() local
591 ssize_t len = smbc->send_size - smbc->sent; in smb_flush()
594 if(!smbc->send_size) in smb_flush()
598 data->state.ulbuf + smbc->sent, in smb_flush()
604 smbc->sent += bytes_written; in smb_flush()
606 smbc->send_size = 0; in smb_flush()
635 struct smb_conn *smbc = &conn->proto.smbc; in smb_send_setup() local
644 byte_count += strlen(smbc->user) + strlen(smbc->domain); in smb_send_setup()
650 Curl_ntlm_core_lm_resp(lm_hash, smbc->challenge, lm); in smb_send_setup()
652 Curl_ntlm_core_lm_resp(nt_hash, smbc->challenge, nt); in smb_send_setup()
660 msg.session_key = smb_swap32(smbc->session_key); in smb_send_setup()
668 MSGCATNULL(smbc->user); in smb_send_setup()
669 MSGCATNULL(smbc->domain); in smb_send_setup()
683 struct smb_conn *smbc = &conn->proto.smbc; in smb_send_tree_connect() local
686 size_t byte_count = strlen(conn->host.name) + strlen(smbc->share); in smb_send_tree_connect()
698 MSGCATNULL(smbc->share); in smb_send_tree_connect()
809 struct smb_conn *smbc = &conn->proto.smbc; in smb_send_and_recv() local
814 if(!smbc->send_size && smbc->upload_size) { in smb_send_and_recv()
815 size_t nread = smbc->upload_size > (size_t)data->set.upload_buffer_size ? in smb_send_and_recv()
816 (size_t)data->set.upload_buffer_size : smbc->upload_size; in smb_send_and_recv()
824 smbc->upload_size -= nread; in smb_send_and_recv()
825 smbc->send_size = nread; in smb_send_and_recv()
826 smbc->sent = 0; in smb_send_and_recv()
830 if(smbc->send_size) { in smb_send_and_recv()
837 if(smbc->send_size || smbc->upload_size) in smb_send_and_recv()
846 struct smb_conn *smbc = &conn->proto.smbc; in smb_connection_state() local
852 if(smbc->state == SMB_CONNECTING) { in smb_connection_state()
885 switch(smbc->state) { in smb_connection_state()
887 if((smbc->got < sizeof(*nrsp) + sizeof(smbc->challenge) - 1) || in smb_connection_state()
893 memcpy(smbc->challenge, nrsp->bytes, sizeof(smbc->challenge)); in smb_connection_state()
894 smbc->session_key = smb_swap32(nrsp->session_key); in smb_connection_state()
908 smbc->uid = smb_swap16(h->uid); in smb_connection_state()
946 struct smb_conn *smbc = &conn->proto.smbc; in smb_request_state() local
995 if(h->status || smbc->got < sizeof(struct smb_nt_create_response)) { in smb_request_state()
1026 if(h->status || smbc->got < sizeof(struct smb_header) + 14) { in smb_request_state()
1036 if(off + sizeof(unsigned int) + len > smbc->got) { in smb_request_state()
1062 if(h->status || smbc->got < sizeof(struct smb_header) + 6) { in smb_request_state()
1137 struct smb_conn *smbc = &conn->proto.smbc; in smb_disconnect() local
1140 Curl_safefree(smbc->share); in smb_disconnect()
1141 Curl_safefree(smbc->domain); in smb_disconnect()
1142 Curl_safefree(smbc->recv_buf); in smb_disconnect()
1157 struct smb_conn *smbc = &conn->proto.smbc; in smb_do() local
1160 if(smbc->share) { in smb_do()
1170 struct smb_conn *smbc = &conn->proto.smbc; in smb_parse_url_path() local
1181 smbc->share = strdup((*path == '/' || *path == '\\') ? path + 1 : path); in smb_parse_url_path()
1183 if(!smbc->share) in smb_parse_url_path()
1186 slash = strchr(smbc->share, '/'); in smb_parse_url_path()
1188 slash = strchr(smbc->share, '\\'); in smb_parse_url_path()
1192 Curl_safefree(smbc->share); in smb_parse_url_path()