Skip to content

Commit

Permalink
Rename uprobe_https_bearssl
Browse files Browse the repository at this point in the history
  • Loading branch information
quarium committed Dec 3, 2024
1 parent 39f6d03 commit 173c72f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions examples/hls2rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#include "upipe-pthread/upipe_pthread_transfer.h"
#include "upipe-pthread/umutex_pthread.h"
#ifdef UPIPE_HAVE_BEARSSL_H
#include "upipe-bearssl/uprobe_https.h"
#include "upipe-bearssl/uprobe_https_bearssl.h"
#endif

#include <pthread.h>
Expand Down Expand Up @@ -1752,7 +1752,7 @@ int main(int argc, char **argv)
uprobe_release(main_probe);
main_probe = &probe_src;
#ifdef UPIPE_HAVE_BEARSSL_H
main_probe = uprobe_https_alloc(main_probe);
main_probe = uprobe_https_bearssl_alloc(main_probe);
#endif
{
struct upipe_mgr *upipe_auto_src_mgr = upipe_auto_src_mgr_alloc();
Expand Down
2 changes: 1 addition & 1 deletion include/upipe-bearssl/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NULL =
myincludedir = $(includedir)/upipe-bearssl
myinclude_HEADERS = \
uprobe_https.h \
uprobe_https_bearssl.h \
$(NULL)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 EasyTools
* Copyright (C) 2020-2024 EasyTools
*
* Authors: Arnaud de Turckheim
*
Expand Down Expand Up @@ -27,8 +27,8 @@
* @short probe catching http scheme hook for SSL connection
*/

#ifndef _UPIPE_BEARSSL_UPROBE_HTTPS_H_
#define _UPIPE_BEARSSL_UPROBE_HTTPS_H_
#ifndef _UPIPE_BEARSSL_UPROBE_HTTPS_BEARSSL_H_
#define _UPIPE_BEARSSL_UPROBE_HTTPS_BEARSSL_H_

#ifdef __cplusplus
extern "C" {
Expand All @@ -41,7 +41,7 @@ extern "C" {
* @param next next probe to test if this one doesn't catch the event
* @return pointer to uprobe, or NULL in case of error
*/
struct uprobe *uprobe_https_alloc(struct uprobe *next);
struct uprobe *uprobe_https_bearssl_alloc(struct uprobe *next);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion lib/upipe-bearssl/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ lib_LTLIBRARIES = libupipe_bearssl.la
libupipe_bearssl_la_SOURCES = \
https_source_hook.h \
https_source_hook.c \
uprobe_https.c \
uprobe_https_bearssl.c \
$(NULL)

libupipe_bearssl_la_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
Expand Down
6 changes: 3 additions & 3 deletions lib/upipe-bearssl/https_source_hook.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 EasyTools
* Copyright (C) 2020-2024 EasyTools
*
* Authors: Arnaud de Turckheim
*
Expand Down Expand Up @@ -27,8 +27,8 @@
* @short HTTPS hooks for SSL data read/write.
*/

#ifndef _UPIPE_MODULES_HTTPS_SOURCE_HOOK_H_
#define _UPIPE_MODULES_HTTPS_SOURCE_HOOK_H_
#ifndef _UPIPE_BEARSSL_HTTPS_SOURCE_HOOK_H_
#define _UPIPE_BEARSSL_HTTPS_SOURCE_HOOK_H_

#include "upipe/uref.h"
#include "upipe-modules/upipe_http_source.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 EasyTools
* Copyright (C) 2020-2024 EasyTools
*
* Authors: Arnaud de Turckheim
*
Expand Down Expand Up @@ -33,17 +33,17 @@

#include "upipe-modules/upipe_http_source.h"

#include "upipe-bearssl/uprobe_https.h"
#include "upipe-bearssl/uprobe_https_bearssl.h"

#include "https_source_hook.h"

/** @This stores the private context of the probe. */
struct uprobe_https {
struct uprobe_https_bearssl {
/** public probe structure */
struct uprobe uprobe;
};

UPROBE_HELPER_UPROBE(uprobe_https, uprobe);
UPROBE_HELPER_UPROBE(uprobe_https_bearssl, uprobe);

/** @internal @This catches events.
*
Expand All @@ -52,7 +52,7 @@ UPROBE_HELPER_UPROBE(uprobe_https, uprobe);
* @param event event thrown
* @param args optional arguments
*/
static int uprobe_https_catch(struct uprobe *uprobe,
static int uprobe_https_bearssl_catch(struct uprobe *uprobe,
struct upipe *upipe,
int event, va_list args)
{
Expand Down Expand Up @@ -85,32 +85,34 @@ static int uprobe_https_catch(struct uprobe *uprobe,

/** @internal @This initializes a HTTPS probe for SSL connection.
*
* @param uprobe_https pointer to the private context
* @param uprobe_https_bearssl pointer to the private context
* @param next next probe to test if this one doesn't catch the event
* @return pointer to uprobe, or NULL in case of error
*/
static struct uprobe *uprobe_https_init(struct uprobe_https *uprobe_https,
struct uprobe *next)
static struct uprobe *
uprobe_https_bearssl_init(struct uprobe_https_bearssl *uprobe_https,
struct uprobe *next)
{
assert(uprobe_https);
struct uprobe *uprobe = uprobe_https_to_uprobe(uprobe_https);
uprobe_init(uprobe, uprobe_https_catch, next);
struct uprobe *uprobe = uprobe_https_bearssl_to_uprobe(uprobe_https);
uprobe_init(uprobe, uprobe_https_bearssl_catch, next);
return uprobe;
}

/** @internal @This cleans a uprobe_https structure.
/** @internal @This cleans a uprobe_https_bearssl structure.
*
* @param uprobe_https pointer to the private context
* @param uprobe_https_bearssl pointer to the private context
*/
static void uprobe_https_clean(struct uprobe_https *uprobe_https)
static void
uprobe_https_bearssl_clean(struct uprobe_https_bearssl *uprobe_https)
{
assert(uprobe_https);
struct uprobe *uprobe = uprobe_https_to_uprobe(uprobe_https);
struct uprobe *uprobe = uprobe_https_bearssl_to_uprobe(uprobe_https);
uprobe_clean(uprobe);
}

#define ARGS_DECL struct uprobe *next
#define ARGS next
UPROBE_HELPER_ALLOC(uprobe_https)
UPROBE_HELPER_ALLOC(uprobe_https_bearssl)
#undef ARGS
#undef ARGS_DECL

0 comments on commit 173c72f

Please sign in to comment.