diff --git a/src/gausskernel/cbb/communication/libcomm_utils/libcomm_client_ssl.cpp b/src/gausskernel/cbb/communication/libcomm_utils/libcomm_client_ssl.cpp index 085f3ef12..97a785959 100644 --- a/src/gausskernel/cbb/communication/libcomm_utils/libcomm_client_ssl.cpp +++ b/src/gausskernel/cbb/communication/libcomm_utils/libcomm_client_ssl.cpp @@ -237,7 +237,20 @@ char* LibCommErrMessage(void) { return errBuf; } - +/* +function name: LibCommClientSSLPasswd +description: As a client, this function is used to detect whether there is a file with a valid key in the specified + directory and whether there is permission to operate it. If so, the password will be decrypted by + using the file. +arguments: The first parameter is a pointer of type (SSL *). + The second parameter is used to obtain the absolute path of the certificate file. + The third parameter represents the user name. + The fourth parameter is a pointer of type (libcommconn *), whose member variable contains the ciphertext to be decrypted. +return value: If the path is empty or does not have operation permission to the directory where the certificate file is located, a non-1 value is returned; otherwise, 0 is returned. +note: none +date: 2022/8/12 +contact tel: 18720816902 +*/ int LibCommClientSSLPasswd(SSL* pstContext, const char * path, const char * userName, LibCommConn * conn) { char* CertFilesDir = NULL; char CertFilesPath[MAXPATH] = {0}; @@ -261,8 +274,8 @@ int LibCommClientSSLPasswd(SSL* pstContext, const char * path, const char * user /*check whether the cipher and rand files begins with userName exist. if exist, decrypt it. - if not,decrypt the default cipher and rand files begins with client%. - Because,for every client user mayown certification and private key*/ + if not,decrypt the default cipher and rand files begins with client. + Because,for every client user may own certification and private key*/ if (NULL == userName) { retval = LibCommClientCheckPermissionCipherFile(CertFilesDir, conn, NULL); if (retval != 1) diff --git a/src/gausskernel/cbb/communication/libcomm_utils/libcomm_lqueue.cpp b/src/gausskernel/cbb/communication/libcomm_utils/libcomm_lqueue.cpp index 56661b33d..eff8ca97d 100644 --- a/src/gausskernel/cbb/communication/libcomm_utils/libcomm_lqueue.cpp +++ b/src/gausskernel/cbb/communication/libcomm_utils/libcomm_lqueue.cpp @@ -33,6 +33,16 @@ inline int mc_lqueue_item_size(struct mc_lqueue_item* q_item) return q_item->element.data->iov_len; } +/* +function name: mc_lqueue_add +description: Add an element to a specific queue. +arguments: The first parameter is a pointer of type (mc_lqueue *), whose member variable list points to the target queue. + The second parameter points to the element to be added to the queue. +return value: Returns 1 if the element is successfully added to the queue, otherwise returns - 1. +note: none +date: 2022/8/13 +contact tel: 18720816902 +*/ int mc_lqueue_add(struct mc_lqueue* q, struct mc_lqueue_item* q_item) { if (q == NULL || q_item == NULL) { @@ -60,6 +70,17 @@ int mc_lqueue_add(struct mc_lqueue* q, struct mc_lqueue_item* q_item) return 1; } +/* +function name: mc_lqueue_remove +description: Remove the head element in a specific queue. +arguments: The first parameter is a pointer of type (mc_lqueue *), whose member variable list points to the target queue. + The second parameter points to the queue head element used to store the removal from the queue. +return value: Return NULL if an error occurs during the removal of the queue head element, otherwise a pointer to + the successfully removed queue head element is returned. +note: none +date: 2022/8/13 +contact tel: 18720816902 +*/ struct mc_lqueue_item* mc_lqueue_remove(struct mc_lqueue* q, struct mc_lqueue_item* q_item) { if (q == NULL) { @@ -89,6 +110,18 @@ struct mc_lqueue_item* mc_lqueue_remove(struct mc_lqueue* q, struct mc_lqueue_it return q_item; } +/* +function name: mc_lqueue_init +description: This function is used to open an area in the memory area. One part of the area is used to store a queue with + a certain specification, and the other part is used to store the information of the queue, such as the specification + and the number of elements. Finally, a pointer to the area is returned. +arguments: This parameter specifies that the maximum number of elements that the queue can hold is size, but this does + not mean that the size of the queue is so large at the beginning. +return value: If the function runs successfully, it returns a pointer to the opened memory area; otherwise, it returns NULL. +note: none +date: 2022/8/13 +contact tel: 18720816902 +*/ struct mc_lqueue* mc_lqueue_init(unsigned long size) { if (size == 0) {