Skip to content

Commit

Permalink
Optimize: Lock on sync
Browse files Browse the repository at this point in the history
  • Loading branch information
badcast committed Nov 18, 2023
1 parent 182eaae commit 9885839
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/core/ui_about.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ void show_about_dialog()
gtk_about_dialog_set_authors(about_dialog, (gchar**)authors);
gtk_about_dialog_set_license_type(about_dialog, GTK_LICENSE_GPL_3_0);
gtk_about_dialog_set_logo_icon_name(about_dialog, "mail-message-new-symbolic");

// Отображение диалогового окна "О программе"
gtk_widget_show_all(GTK_WIDGET(about_dialog));

Expand Down
2 changes: 1 addition & 1 deletion src/core/ui_authorize.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ int tea_get_server_id(const char *serverURI)
{
int id = 1;

while(*serverURI && (id *= 1 | (int) *(serverURI++)))
while(*serverURI && (id *= (1 | (int) *(serverURI++))))
;

return id;
Expand Down
12 changes: 7 additions & 5 deletions src/net/tea_net_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,14 @@ int net_send(const char *url, const char *body, size_t len, struct net_responce_
net_stats.active_requests--;

if(net_result == CURLE_OK)
{
++net_stats.success_req;
else
++net_stats.error_req;

g_mutex_unlock(&nmutex);

if(net_result == CURLE_OK)
{
for(int x = 0; x < receiver->size; ++x)
{
if(receiver->raw_data[x] == '{')
Expand All @@ -132,8 +138,6 @@ int net_send(const char *url, const char *body, size_t len, struct net_responce_
}
else
{
++net_stats.error_req;

if(receiver->raw_data)
{
free(receiver->raw_data);
Expand All @@ -145,8 +149,6 @@ int net_send(const char *url, const char *body, size_t len, struct net_responce_
#endif
}

g_mutex_unlock(&nmutex);

receiver->net_status = net_result;

// if(net_result == CURLE_OK){
Expand Down

0 comments on commit 9885839

Please sign in to comment.